﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    internal class RelIncAB
    {
        public static void A([In] string obj0)
        {
            StackTrace stackTrace = new StackTrace();
            string str1 = stackTrace.GetFrame(1).GetMethod().DeclaringType.ToString().Split('.')[0];
            stackTrace.GetFrame(1).GetMethod().ToString();
            FileStream fileStream = (FileStream)null;
            StreamWriter streamWriter1 = (StreamWriter)null;
            try
            {
                string path1 = AppDomain.CurrentDomain.BaseDirectory + Unk.z();
                if (!path1.EndsWith(Unk.aA()))
                    path1 += Unk.aA();
                string str2 = path1;
                DateTime now = DateTime.Now;
                string str3 = now.ToString(Unk.aa());
                string str4 = Unk.aB();
                string path2 = str2 + str3 + str4;
                if (!Directory.Exists(path1))
                    Directory.CreateDirectory(path1);
                if (!File.Exists(path2))
                    File.CreateText(path2).Dispose();
                fileStream = new FileStream(path2, FileMode.Append, FileAccess.Write, FileShare.ReadWrite);
                streamWriter1 = new StreamWriter((Stream)fileStream, Encoding.UTF8);
                StreamWriter streamWriter2 = streamWriter1;
                now = DateTime.Now;
                string str5 = now.ToString();
                streamWriter2.WriteLine(str5);
                streamWriter1.WriteLine(obj0);
                streamWriter1.WriteLine(Unk.ab());
                streamWriter1.Flush();
                fileStream.Flush();
            }
            catch (Exception ex)
            {
                Unk.b();
            }
            finally
            {
                if (streamWriter1 != null)
                {
                    try
                    {
                        streamWriter1.Close();
                        streamWriter1.Dispose();
                    }
                    catch
                    {
                    }
                }
                if (fileStream != null)
                {
                    try
                    {
                        fileStream.Close();
                        fileStream.Dispose();
                    }
                    catch
                    {
                    }
                }
            }
        }
    }
}
